package com.colllection;

public class HomeWork {
//    private static int num=100;
//  static int xxx=100;
//
//    public static void main(String[] args) {
//        HomeWork homeWork = new HomeWork();
//        homeWork.num++;
//        homeWork.num=10;
//        System.out.println(num);
//
//        A a=null;
//        a.print();
//    }
}
class A{

    public static void print(){
        System.out.println("======");
    }
}
//class Base {
//    Base() {
//        System.out.print("Base");
//    }
//}
//
// class Alpha extends Base {
//
//    public static void main( String[] args ) {
//        new Alpha();//1
//        //调用父类无参的构造方法
//        new Base();//2
//    }
//}
class Base{
    public Base(String s){
        System.out.print("B");
    }
}

class Derived extends Base{
    public Derived (String s) {
        super(s);
        System.out.print("D");
    }
    //public static void main(String[] args){
   //     new Derived("C");
  //  }
}
class X{
    Y y=new Y();//1
    public X(){//2
        System.out.print("X");
    }
}
class Y{
    public Y(){//3
        System.out.print("Y");
    }
}
 class Z extends X{
    Y y=new Y();//4
    public Z(){//5
        System.out.print("Z");
    }
//    public static void main(String[] args) {
//        new Z();
    }

class B {
    public int Func() {
        System.out.print("B");
        return 0;
    }
}
class D extends B {
    @Override
    public int Func() {
        System.out.print("D");
        return 0;
    }
}
class Test {
    public static void main(String[] args) {
        B a = new B();
        B b = new D();
        a.Func();
        b.Func();
    }
}